//
//  WorkReportSearchViewController.m
//  Utils
//
//  Created by enghou on 2018/6/4.
//  Copyright © 2018年 xyxorigation. All rights reserved.
//

#import "WorkReportSearchViewController.h"

@interface WorkReportSearchViewController ()

@end

@implementation WorkReportSearchViewController

-(instancetype)init{
    UIStoryboard *search = [UIStoryboard storyboardWithName:@"WorkReportSearch" bundle:[NSBundle mainBundle]];
    return [search instantiateInitialViewController];
}


- (void)viewDidLoad {
    [super viewDidLoad];
    UIBarButtonItem *query = [[UIBarButtonItem alloc]initWithTitle:@"查询" style:UIBarButtonItemStylePlain target:self action:@selector(queryAction)];
    query.tintColor = [UIColor whiteColor];
    self.navigationItem.rightBarButtonItem = query;
}

-(void)queryAction{
    if ([self.delegate respondsToSelector:@selector(fetchParameter:)]) {
        NSMutableDictionary *param = [NSMutableDictionary dictionary];
        [param setObject:self.titleField.text forKey:@"workDiaryVo.title"];
        [param setObject:self.senderField.text forKey:@"workDiaryVo.workUser"];
        [param setObject:self.beginDateField.text forKey:@"workDiaryVo.workTimeStart"];
        [param setObject:self.endDateField.text forKey:@"workDiaryVo.workTimeEnd"];
        [self.delegate fetchParameter:param];
        [self pop];
    }else{
        [self pop];
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
@end
